"""
物理常量
"""
from .unit import unit, Q_

PI = Q_(3.1415926, 'rad')
"""圆周率 """

# 地球形状参数，来自于 WGS-84 https://en.wikipedia.org/wiki/World_Geodetic_System

EARTH_MAJOR_AXIS = Q_(6378137.0, 'm')
"""地球长半轴 """

EARTH_MINOR_AXIS = Q_(6356752.314245, 'm')
"""地球短半轴 """

EARTH_RADIUS = EARTH_MAJOR_AXIS
"""地球半径（长半轴） """

EARTH_INVERSE_FLATTENING = Q_(298.257223563, 'dimensionless')
"""地球扁率倒数 """

EARTH_FLATTENING = Q_(1 / EARTH_INVERSE_FLATTENING, 'dimensionless')
"""地球扁率 """

# 地球物理常量
EARTH_GRAVITY = Q_(9.80665, 'm/s**2')
"""标准重力加速度 https://en.wikipedia.org/wiki/Gravity_of_Earth"""

SOLAR_DAY = Q_(86400, 's')
"""太阳日"""

SIDEREAL_DAY = Q_(86164.0905, 's')
"""恒星日 https://en.wikipedia.org/wiki/Sidereal_time"""

EARTH_ROTATION_ANGULAR_VELOCITY = 2 * PI / SIDEREAL_DAY
"""地球自转角速度 Omega"""

ROSSBY_PARAMETER_ON_EQUATOR = 2 * EARTH_ROTATION_ANGULAR_VELOCITY / EARTH_RADIUS
"""赤道上的罗斯贝参数"""

EARTH_EQUATOR_LENGTH = Q_(2 * PI * EARTH_RADIUS, 'm')
"""地球赤道长度"""

LENGTH_PRE_LATITUDE = EARTH_EQUATOR_LENGTH / 360
"""一度纬度的长度"""